package com.example.feigndemo;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;

@FeignClient(value = "eureka-client-demo",fallback = HelloWorldService.HystrixClientFallback.class)
public interface HelloWorldService {
    @GetMapping("/hi")
    String hi();
    @Component
    class  HystrixClientFallback implements HelloWorldService {

        @Override
        public String hi() {
            return "fallbak";
        }
    }

}


